<?php $this->load->view('header');?>

<body class="childrenBody custom_body">
	<div class="custom_main">
		<fieldset class="layui-elem-field layui-field-title">
		  <legend>场馆信息</legend>
		</fieldset>

		<form class="layui-form">
			<div class="layui-form-item">
				<label class="layui-form-label custom_i"><i>*</i> 场馆名称：</label>
				<div class="layui-input-inline">
					<input type="text" name="name" required lay-verify="required" placeholder="请输入名称" autocomplete="off" class="layui-input" value="<?=$name?>">
				</div> 
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label custom_i"> 联系电话：</label>
				<div class="layui-input-inline">
					<input type="text" name="mobile" required lay-verify="required" placeholder="请输入手机" autocomplete="off" class="layui-input" value="<?=$mobile?>">
				</div> 
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label custom_i"> 地址：</label>
				<div class="layui-input-inline">
					<input type="text" name="address" required lay-verify="required" placeholder="请输入地址" autocomplete="off" class="layui-input" value="<?=$address?>">
				</div> 
			</div>
			
			<div class="layui-form-item">
				<div class="layui-input-block">
					<input type="hidden" name="venue_id" value="<?=$venue_id?>" />
					<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="addUser">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			    </div>
			</div>
		</form>
		
	</div>

	<script type="text/javascript">
		layui.config({
			version: true
		}).use(['jquery','layer', 'form', 'laytpl'],function(){
			var form = layui.form,
				layer = parent.layer === undefined ? layui.layer : parent.layer,
				laypage = layui.laypage,
				laytpl = layui.laytpl,
				$ = layui.jquery;

				//提交表单
				form.on("submit(addUser)",function(data)
				{
					$.post('admin.php/Venue/insert_venue', data.field, function(result) {
						if (result.status == 200) 
						{
							layer.msg(result.message, {icon: 1});
							location.reload();
						}
						else
						{
							layer.msg(result.message, {icon: 5});
						}

					},"json");

					return false;
				});

				form.render(); //更新全部

		});

	</script>

</body>
</html>